#!/usr/local/bin/perl

$text_file =  "/home/naila/Naila_Thesis/moses_working_dir/data/test.fr";
$sgm_file =  "/home/naila/Naila_Thesis/moses_working_dir/data/test-src.fr.sgm";
open FR,"<",$text_file;
open FW,">",$sgm_file;


open(FF,$text_file) || die("Cannot open file");
print FW "<srcset setid=\"test\" srclang=\"any\">";
print FW "\n";
print FW "<DOC docid=\"test\" sysid=\"ref\">";
print FW "\n";
my $count = 0;
while(<FF>)
{
	chomp;
	s/\n//;
	
	print FW "<seg id=$count> $_ </seg>";
	print FW "\n";
	$count++;
}
	print FW "</DOC>";
	print FW "</srcset>";

close FR;
close FW;



